﻿<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:perso="clr-namespace:UMLTouch.UI.Controls;assembly=UMLTouch.UI.Controls"
    xmlns:compModel="clr-namespace:System.ComponentModel;assembly=WindowsBase"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" x:Class="UMLTouch.UI.Start.Views.DiagramContextView"
    mc:Ignorable="d"
    >
    <DockPanel>
       
        <Menu DockPanel.Dock="Top" Background="White">
            <MenuItem Command="{Binding SwitchEditModeCmd}" Header="EditMode"/>
            <Slider x:Name="slider" Width="100" Maximum="5" Minimum="1" Value="1" Interval="1"/>
        </Menu>
    	<Border Background="{DynamicResource HatchBrush}" BorderBrush="#FF83BCFF" CornerRadius="0,0,14,14" BorderThickness="1" >
    		<ScrollViewer HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" CanContentScroll="True" Margin="0" d:LayoutOverrides="Width, Height">
        
    			<perso:DiagramCanvas Strokes="{Binding Strokes}" 
    				Source="{Binding DiagramItems}"
    				SelectionMode="{Binding SelectionMode}" Background="{x:Null}" RenderTransformOrigin="0.5,0.5" ResizeEnabled="False" MinWidth="100" MinHeight="100">   
    				<perso:DiagramCanvas.LayoutTransform>
    					<TransformGroup>
    						<ScaleTransform ScaleX="{Binding Value, ElementName=slider, Mode=Default}" ScaleY="{Binding Value, ElementName=slider, Mode=Default}"/>
    						<SkewTransform/>
    						<RotateTransform/>
    						<TranslateTransform/>
    					</TransformGroup>
    				</perso:DiagramCanvas.LayoutTransform>   
    			</perso:DiagramCanvas>
    		</ScrollViewer>
    	</Border>
    </DockPanel>
</UserControl>
